package net.st.controller;

import java.net.URL;

import net.htmlparser.jericho.Element;
import net.htmlparser.jericho.HTMLElementName;
import net.htmlparser.jericho.Source;
import net.st.util.DataUtil;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

public class IndexController extends Controller {

	@Override
	public Navigation run() throws Exception {
		System.out.println("index");
		final Source source = new Source(new URL("http://naver.com/"));
		Element el = source.getElementById("wrap")
				.getAllElements(HTMLElementName.DIV).get(0);

		System.out.println(DataUtil.encryptString(el.toString()));
		System.out.println(DataUtil.encryptString(el.toString() + " "));

		return forward("index.jsp");
	}
}
